//MemMalloc

#include <stdlib.h>

size_t objectsAllocated = 0;

void *mem_malloc(size_t size) 
{
  // log
  void * o = malloc(size);
  if(o != NULL)
    objectsAllocated++;
  else
    return NULL;
  
  return o;
}

void mem_free(void *ptr) 
{
// log
  objectsAllocated--;
  free(ptr);
}

size_t getAllocated()
{
  return objectsAllocated;
}